/**
 *
 */
package info.hexin.dubbo.test3.server;

import info.hexin.dubbo.util.ThreadPool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;
import java.util.concurrent.TimeUnit;

public class DemoServerImpl implements DemoServer {
    private static Logger logger = LoggerFactory.getLogger(DemoServerImpl.class);

    public String sayHello(final String str) {
        logger.info("serverstart:" + str);
        ThreadPool.execute(new Runnable() {
            public void run() {
                String str1 = "Hello " + str + "  server send:" + new Date();
                try {
                    TimeUnit.SECONDS.sleep(30);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                logger.info("serverend:" + str1);
            }
        });
        return str;
    }
}
